package mtt.model.calendar;

public class Event {

	/**
	 * Statische Variablen zur Definition der intTimeOfDate
	 */
	public static final int index_TIME_07To09 = 0;
	public static final int index_TIME_09To11 = 1;
	public static final int index_TIME_11To13 = 2;
	public static final int index_TIME_13To15 = 3;
	public static final int index_TIME_15To17 = 4;
	public static final int index_TIME_17To19 = 5;
	public static final int index_TIME_19To21 = 6;

	/**
	 * definiert den Tag an dem der Event ist (Event.DAY_*)
	 */
	private int dayOfEvent;

	/**
	 * @uml.property name="intId"
	 */
	private Integer intId;

	/**
	 * @uml.property name="intIntervall"
	 */
	private Integer intIntervall;

	/**
	 * enthält den Integer Wert für die Uhrzeit (Event.TIME_*) zu der dieser
	 * Event stattfinden soll
	 * 
	 * @uml.property name="intTimeOfDate"
	 */
	private Integer intTimeOfDate;

	/**
	 * Enthält den Typ des Termins in form der int-value von Event.indexTyp*
	 * 
	 * @uml.property name="intTyp"
	 */
	private Integer intTyp;

	/**
	 * @uml.property name="stringTutor"
	 */
	private String stringTutor = "";

	/**
	 * @uml.property name="stringName"
	 */
	private String stringName = "";

	/**
	 * @uml.property name="stringOrt"
	 */
	private String stringOrt = "";

	public int getDayOfEvent() {
		return dayOfEvent;
	}

	/**
	 * liefert den Index des Events
	 * 
	 * @return
	 */
	public Integer getTimeIndexOfEvent() {
		return this.intTimeOfDate;
	}

	/**
	 * liefert den String zur übergebenen Id
	 * @return string value of Day.ID_* oder null
	 */
	public static String getStringOfTimeId(int id){
		//TODO parameter prüfen
		
		switch (id) {
			case index_TIME_07To09 : return "07-09";
			case index_TIME_09To11 : return "09-11";
			case index_TIME_11To13 : return "11-13";
			case index_TIME_13To15 : return "13-15";
			case index_TIME_15To17 : return "15-17";
			case index_TIME_17To19 : return "17-19";
			case index_TIME_19To21 : return "19-21";
			
			default:
				return null;
		}	
	}
	
	/**
	 * Getter of the property <tt>intId</tt>
	 * 
	 * @return Returns the intId.
	 * @uml.property name="intId"
	 */
	public Integer getIntId() {
		return intId;
	}

	/**
	 * Getter of the property <tt>intInterval</tt>
	 * 
	 * @return Returns the intInterval.
	 * @uml.property name="intIntervall"
	 */
	public Integer getIntIntervall() {
		return intIntervall;
	}

	/**
	 * Getter of the property <tt>stringTyp</tt>
	 * 
	 * @return Returns the stringTyp.
	 * @uml.property name="intTyp"
	 */
	public Integer getIntTyp() {
		return intTyp;
	}

	/**
	 * Getter of the property <tt>stringTutor</tt>
	 * 
	 * @return Returns the stringTutor.
	 * @uml.property name="stringTutor"
	 */
	public String getStringTutor() {
		return stringTutor;
	}

	/**
	 * Getter of the property <tt>stringName</tt>
	 * 
	 * @return Returns the stringName.
	 * @uml.property name="stringName"
	 */
	public String getStringName() {
		return stringName;
	}

	/**
	 * Getter of the property <tt>stringOrt</tt>
	 * 
	 * @return Returns the stringOrt.
	 * @uml.property name="stringOrt"
	 */
	public String getStringOrt() {
		return stringOrt;
	}

	public void setDayOfEvent(int dayOfEvent) {
		this.dayOfEvent = dayOfEvent;
	}

	/**
	 * Setter of the property <tt>intId</tt>
	 * 
	 * @param intId
	 *            The intId to set.
	 * @uml.property name="intId"
	 */
	public void setIntId(Integer intId) {
		this.intId = intId;
	}

	/**
	 * Setter of the property <tt>intInterval</tt>
	 * 
	 * @param intInterval
	 *            The intInterval to set.
	 * @uml.property name="intIntervall"
	 */
	public void setIntIntervall(Integer intIntervall) {
		this.intIntervall = intIntervall;
	}

	public void setTimeIndexOfEvent(Integer indexTimeOfEvent) throws IndexOutOfBoundsException {
		if ((indexTimeOfEvent.intValue() < index_TIME_07To09) || (indexTimeOfEvent.intValue() > index_TIME_19To21)) {
			throw new IndexOutOfBoundsException("Der indexTimeOfEvent muss zwischen Event.index_TIME_07To09 und Event.index_TIME_19To21");
		}
		
		this.intTimeOfDate = indexTimeOfEvent;
	}

	/**
	 * Setter of the property <tt>stringTyp</tt>
	 * 
	 * @param stringTyp
	 *            The stringTyp to set.
	 * @uml.property name="intTyp"
	 */
	public void setIntTyp(Integer intTyp) {
		this.intTyp = intTyp;
	}

	/**
	 * Setter of the property <tt>stringTutor</tt>
	 * 
	 * @param stringTutor
	 *            The stringTutor to set.
	 * @uml.property name="stringTutor"
	 */
	public void setStringTutor(String stringDozent) {
		this.stringTutor = stringDozent;
	}

	/**
	 * Setter of the property <tt>stringName</tt>
	 * 
	 * @param stringName
	 *            The stringName to set.
	 * @uml.property name="stringName"
	 */
	public void setStringName(String stringName) {
		this.stringName = stringName;
	}

	/**
	 * Setter of the property <tt>stringOrt</tt>
	 * 
	 * @param stringOrt
	 *            The stringOrt to set.
	 * @uml.property name="stringOrt"
	 */
	public void setStringOrt(String stringOrt) {
		this.stringOrt = stringOrt;
	}

}
